import {
	defineStore
} from 'pinia'
import {
	reactive,
	toRefs,
	ref
} from "vue"
export const useCounterStore = defineStore('counter', () => {
	let data = reactive({
		formData: {
			name: '',
			id_no: '',
			bank_card_no: '',
			mobile: '',
			sms_code: '',
			front_id_card_code: '',
			back_id_card_code: '',
			electronic_signature_code: '',
			sms_trace_id: ''
		},
		mchId: '',
		userId: ''
	})
	let {
		formData,
		mchId,
		userId
	} = toRefs(data);

	const setFormData = (data) => {
		formData.value = data
	}
	const setMchId = (data) => {
		mchId.value = data
	}
	const setUserId = (data) => {
		userId.value = data
	}

	return {
		mchId,
		userId,
		formData,
		setFormData,
		setMchId,
		setUserId
	}
})